//
//  Global.swift
//  swiftTXH
//
//  Created by Mac mini on 2020/6/5.
//  Copyright © 2020 Mac mini. All rights reserved.
//

import UIKit

public let cnm_screenBounds = UIScreen.main.bounds
public let cnm_screenWidth  = UIScreen.main.bounds.width
public let cnm_screenHeight = UIScreen.main.bounds.height
public let cnm_ud = UserDefaults.standard

// 机型判断
/// iPhone5 iPhone5s iPhoneSE
public let cnm_iPhoneSE = (UIScreen.instancesRespond(to: #selector(getter: UIScreen.main.currentMode)) ? CGSize(width: 640, height: 1136).equalTo((UIScreen.main.currentMode?.size)!) : false)

/// iPhone6 7 8
public let cnm_iPhone8 =  (UIScreen.instancesRespond(to: #selector(getter: UIScreen.main.currentMode)) ? CGSize(width: 750, height: 1334).equalTo((UIScreen.main.currentMode?.size)!) : false)

/// iphoneXR
public let cnm_iPhoneXR =  (UIScreen.instancesRespond(to: #selector(getter: UIScreen.main.currentMode)) ? CGSize(width: 828, height: 1792).equalTo((UIScreen.main.currentMode?.size)!) : false)

/// iPhone6plus  iPhone7plus iPhone8plus
public let cnm_iPhone8Plus =  (UIScreen.instancesRespond(to: #selector(getter: UIScreen.main.currentMode)) ? CGSize(width: 1242, height: 2208).equalTo((UIScreen.main.currentMode?.size)!) : false)

/// iPhoneX
public let cnm_iPhoneX =  (UIScreen.instancesRespond(to: #selector(getter: UIScreen.main.currentMode)) ? CGSize(width: 1125, height: 2436).equalTo((UIScreen.main.currentMode?.size)!) : false)

/// iphoneXsMax
public let cnm_iPhoneXsMax =  (UIScreen.instancesRespond(to: #selector(getter: UIScreen.main.currentMode)) ? CGSize(width: 1242, height: 2688).equalTo((UIScreen.main.currentMode?.size)!) : false)

